import device from '@/api/apis/device'

/**
 * <p>
 * 弹窗配置
 *
 * @Author：Roy
 * @Description：楼栋
 * @Date：Create by 2023-11-23 09:55:22
 */
const popConfig = {
  'scene-floor': {
    'scene-floor-add': {
      popTitle: '新增楼栋',
      popType: 'OperateSceneEdifice',
      visible: true,
      popConfig: {
        width: '40%',
        destroy: true,
        popType: 'add',
        maxHeight: '5000px'
      }
    },
    'scene-floor-edit': {
      popTitle: '编辑楼层',
      popType: 'OperateSceneFloor',
      visible: true,
      popConfig: {
        width: '40%',
        destroy: true,
        maxHeight: '5000px'
      }
    },
    'scene-floor-look': {
      popTitle: '查看楼层',
      popType: 'OperateSceneFloor',
      visible: true,
      popConfig: {
        width: '50%',
        destroy: true,
        maxHeight: '5000px',
        hideFooterBtn: true,
        disabled: true
      }
    },
    'scene-company-look-facility': {
      popTitle: '查看设备列表',
      popType: 'FacilityList',
      visible: true,
      popConfig: {
        width: '50%',
        destroy: true,
        maxHeight: '5000px',
        paramName: 'sceneFloorId',
        path: 'device.queryList',
      }
    },
    'scene-floor-delete': {
      showType: 'confirm',
      confirmHeader: '提示',
      confirmContent: '将删除XXX的所有关联数据，是否确认删除？',
      splitProp: 'floorName',
      idCode: 'dict',
      paramsProp: { id: 'id' },
      dynamicConfirmContent: async (data) => {
        const res = await device.existDevice({sceneFloorId: data.id})
        return {
          exist: res.data,
          confirmContent: res.data ? '您即将删除【XXX】楼层，该楼层关联有设备信息，请先解绑/删除关联的设备' : '您即将删除【XXX】楼层，此操作将导致与该楼层关联的所有碳汇、碳资产等数据停止生成且不再被系统记录与展示，确认删除？'
        }
      },
      path: 'sceneFloor.deleteById'
    },
    'scene-floor-import': {
      popTitle: '导入',
      popType: 'AddFile',
      visible: true,
      popConfig: {
        width: '50%',
        hideFooterBtn: true,
        // 上传接口
        upLoadPath: '/energy-carbon/ecp-admin/sceneEdifice/upload',
        // 模板下载参数
        tplName: 'sceneEdificeRenderer'
      }
    },
    'scene-floor-deleteBatch': {
      showType: 'confirm',
      dataType: 'multipleList',
      confirmHeader: '提示',
      confirmContent: '将批量删除XXX楼栋及所有绑定关联的数据，是否确认删除？',
      splitProp: 'floorName',
      paramsProp: { ids: 'id' },
      path: 'sceneFloor.batchDelete'
    }
  }
}

export default {}
export { popConfig }
